/*
 * Created: Author: Aléx Carvalho / Date: Mar 4, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-06-11 01:31:49 -0300 (Thu, 11 Jun 2015) $
 */
package com.cpm.view.zk.field;

public enum FieldValidator{
    
    NOT_NULL("",""){

        @Override
        public boolean validate(Object value) {
            return value != null;
        }
    
    },
    NOT_EMPTY("",""){

        @Override
        public boolean validate(Object value) {
            return NOT_NULL.validate(value) && !value.toString().trim().isEmpty();
        }
    };

    private final String jsFunction;
    private final String menssage;
    
    private FieldValidator(String jsFunction, String menssage) {
        this.jsFunction = jsFunction;
        this.menssage = menssage;
    }
    
    public abstract boolean validate(Object value);
}
